#ifndef BIKECOMMANDUTIL_H
#define BIKECOMMANDUTIL_H

#include <string>
#include <vector>

class BikeCommandUtil {
public:
    static unsigned char sender;
    static unsigned char length;
    static std::vector<unsigned char> operationCode;
    static std::vector<unsigned char> data; // 除去校验和和结束符
    static unsigned char checksum;
    static unsigned char end;
    static std::string operatorCommand;
    static double units[15];
    static int bitsForEvery[15];

    static std::string parseCommand(const std::string& command);
    static int calculateChecksum(const std::vector<unsigned char>& operationCode, const std::vector<unsigned char>& data);
    static std::string processOperatorCommand(const std::string& operatorCommand);
    static std::vector<unsigned char> hexStringToByteArray(const std::string& s);
    static std::string bytesToHex(const std::vector<unsigned char>& bytes, int len);
    static std::string byteArrayToString(const std::vector<unsigned char>& byteArray);
    static void print();
    static std::vector<int> parseFitnessData(const std::vector<unsigned char>& bytes);
    static std::vector<int> parse(const std::vector<unsigned char>& bytes);
    static int parseData(const std::vector<unsigned char>& bytes, int offset, int len, double scale);
};

#endif // BIKECOMMANDUTIL_H




